using System.Text.RegularExpressions;

namespace AgileNYCWebService
{
    public static class RegexHelper
    {
        #region "Variables"

        /// <summary>
        ///     Default regular expression options
        /// </summary>
        private static RegexOptions _defaultOptions = RegexOptions.Compiled;

        #endregion "Variables"

        #region "Properties"

        /// <summary>
        ///     Default regular expression options
        /// </summary>
        public static RegexOptions DefaultOptions
        {
            get { return _defaultOptions; }
            set { _defaultOptions = value; }
        }

        #endregion "Properties"

        #region "Methods"

        public static Regex GetRegex(string pattern)
        {
            return GetRegex(pattern, DefaultOptions);
        }

        public static Regex GetRegex(string pattern, RegexOptions options)
        {
            var result = new Regex(pattern, options);

            return result;
        }

        #endregion "Methods"
    }
}